﻿@model PagedList<ReleaseOrder>
<table class="table">
    <thead>
        <tr>
            <th style="width: 20px">
                @if (User.IsInRole("FINACE"))
                {
                    <input type="checkbox" onclick="CheckAll()" id="checkAll" />
                }
            </th>
            <th>
                银行账单
            </th>
            <th>
                客户编号
            </th>
            <th>
                客户名
            </th>
            <th>
                签出金额
            </th>
            <th>
                状态
            </th>
            <th>
                申请人
            </th>
            <th>
                申请时间
            </th>
            <th>
                审批人
            </th>
            <th>
            </th>
        </tr>
    </thead>
    <tbody id="dvReleaseOrder">
        @foreach (var item in Model)
        {
            <tr>
                <td style="width: 20px">
                    @if (item.Status < 2 && User.Identity.Name == item.Approver && User.IsInRole("FINACE"))
                    {
                        <input name="selected" type="checkbox" value="@item.Id" />
                    }
                </td>
                <td>@Html.DetailsLink(item.Id, item.BankData.Assiginment)
                </td>
                <td>@item.CustomerCode
                </td>
                <td>@item.CustomerName
                </td>
                <td>@item.Amount
                </td>
                <td>@BindDropDownList.ApprovalName(item.Status)
                </td>
                <td> @BindDropDownList.GetUserName(item.ApplyMan)
                </td>
                <td>@Html.DisplayFor(m => item.ApplyTime)
                </td>
                <td>@BindDropDownList.GetUserName(item.Approver)
                </td>
                <td>
                    @if (item.Status < 2 &&User.Identity.Name==item.Approver && User.IsInRole("FINACE") )
                    { 
                        @Html.ShortcutLink("同意", "ConfirmOrder", new { item.Id })
                        @Html.ShortcutLink("拒绝", "RejectOrder", new { item.Id })
                    }
                </td>
            </tr>
        }
    </tbody>
</table>
@Html.CommonPager(Model, ViewData["SearchModel"])
